<?php

/**
 *	Action getAll equivalent INDEX
 *
 */

if ($action == "getAll") {
	
	// On init chiffre 1
	$chiffres1 = array(5, 8, 11, 17, 35);
//	$chiffres1 = array(5);
	
	// On init chiffre 2
	$chiffres2 = array();
	for ($i = 1; $i <= 20; $i++) {
//	for ($i = 1; $i <= 5; $i++) {	
		if ($i != 10) {
			$chiffres2[] = $i;
		}
	}


	// on genere toutes les multiplications
	$ret = array();

	foreach ($chiffres1 as $c1) {
		foreach ($chiffres2 as $c2) {
			$one = array();
			$one['chiffre1'] = $c1;
			$one['chiffre2'] = $c2;
			$one['resultat'] = $c1 * $c2;						
			$ret[] = $one;
		}
	}
	shuffle($ret);

	echo(json_encode($ret));
}
